package com.zr0726.news.service;

import com.zr0726.news.po.News;
import com.zr0726.news.vo.NewsQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

public interface NewsService {

    //新闻管理页面，组合条件查询
    Page<News> listNews(Pageable pageable, NewsQuery newsQuery);

    News saveNews(News news);

    News getNews(Long id);

    News updateNews(Long id, News news);

    void deleteNews(Long id);

    //主页显示新闻列表
    Page<News> listNews(Pageable pageable);

    //主页推荐最新新闻列表
    List<News> listRecommendNewsTop(Integer size);

    //主页搜索新闻列表
    Page<News> listNews(String query, Pageable pageable);

    News getAndConvertNews(Long id);

    //标签页面查看新闻
    Page<News> listNews(Long tagId, Pageable pageable);

    Map<String, List<News>> archiveNews();

    Long countNews();
}
